package com.itheima.mapper;

import com.itheima.pojo.Clazz;
import com.itheima.pojo.ClazzPageRequest;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper {
    //分页条件查询所有班级
    List<Clazz> queryPageClazz(ClazzPageRequest clazzPageRequest);

    //新增班级
    void insertClazz(Clazz clazz);

    //修改班级,1.根据id查询班级
    @Select("select * from clazz where id = #{id}")
    Clazz queryByIdClazz(Integer id);

    //修改班级,2.修改信息
    void updateClazz(Clazz clazz);

    //删除班级
    @Delete("delete from clazz where id = #{id}")
    void deleteClazz(Integer id);



//    查询全部班级
    @Select("select * from clazz")
    List<Clazz> queryClazzs();

}
